package com.lanou.managerLogin.book.web.servlet;

import com.lanou.managerLogin.category.dao.CategoryDao;
import com.lanou.managerLogin.category.dao.CategoryDaoImpl;
import com.lanou.managerLogin.category.domain.Category;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/insertBookServlet")
public class InsertBookServlet extends HttpServlet {

    private CategoryDao cd = new CategoryDaoImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Category> categoryList = cd.selectCname();
        req.setAttribute("categoryList",categoryList);
        req.getRequestDispatcher("/adminjsps/admin/book/add.jsp").forward(req, resp);
    }
}
